<template>
    <div class="m-doctoritem" @click="toDoctorDetail">
        <img :src="doctoritem.HeadImg" alt="">
        <span>{{doctoritem.Name}}</span>
        <p>{{doctoritem.Skill}}</p>
    </div>
</template>
<script>
export default {
    name:'',
    props:['doctor'],
    data () {
        return {
            doctoritem:'',
        }
    },
    methods: {
        toDoctorDetail() {
            this.$router.push({name:'doctorDetail',query:{id:this.doctor.Id}});
        }
    },
    mounted() {
        let doctor = this.doctor;
        let headerImg = doctor.HeadImg;
        if(headerImg != null){
            if(headerImg.substring(0,4)!='http'){
                doctor.HeadImg = headerImg;
            }
        }else{
            doctor.HeadImg = require('@/assets/images/my.png');
        }
        
        this.doctoritem = doctor;
    }
}
</script>
<style lang="less" scoped src="@/less/doctor/doctor.less"></style>
